<!DOCTYPE html>
<html>
<head>
    <title>{$site_info['site_name']}</title>
    <include file="appapi@head"/>
    <link href='__STATIC__/appapi/css/agent_share.css' type="text/css" rel="stylesheet">
</head>
<body>
    <div class="share">
        <div class="share_bg">
            <img src="__STATIC__/appapi/images/agentshare/bg.png">
        </div>
        <div class="share_bd">
            <div class="share_logo">
                <img src="/logo.png">
            </div>
            <div class="share_name">
                {$site_info['site_name']}
            </div>
            <div class="share_dsc">
                <img src="__STATIC__/appapi/images/agentshare/{:lang('agent_share_des')}.png">
            </div>
            <div class="share_info">
                <div class="userinfo">
                    <div class="userinfo_avatar"><img src="{$userinfo['avatar']}"></div>
                    <div class="userinfo_info">
                        <div class="userinfo_info_bd">
                            <p class="userinfo_name">{$userinfo['user_nickname']}</p>
                            <p class="userinfo_id">ID:{$userinfo['id']}</p>
                        </div>
                    </div>
                </div>
                <div class="share_code">
                    <p class="share_code_t">{:lang('邀请码')}</p>
                    <p class="share_code_bd">{$code}</p>
                </div>
                <div class="share_down">
                    <div class="share_down_bd">
                        <div class="share_down_bd_btn" onclick="down()">{:lang('立即下载')}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <include file="appapi@footer"/>
    <include file="appapi@scripts"/>
    <script type="text/javascript">
        $(function(){
            var code='{$code}';
            var openinstall_switch={$openinstall_switch};
            if(openinstall_switch){
                location.href='/appapi/Agent/downapp?code='+code;
            }else{
                var isiPad = /iPad/i.test(navigator.userAgent);
                var isiPhone = /iPhone|iPod/i.test(navigator.userAgent);
                var isAndroid = /Android/i.test(navigator.userAgent);
                var isWeixin = /MicroMessenger/i.test(navigator.userAgent);
                var isQQ = /QQ/i.test(navigator.userAgent);
                var isIOS = (isiPad || isiPhone);
                var isWeibo = /Weibo/i.test(navigator.userAgent);
                var isApp = (isAndroid || isIOS);

                $(".share_down_bd_btn").click(function(){
                    if(isIOS){
                        location.href="{$site_info['ipa_url']}";
                    }else{
                        location.href="{$site_info['apk_url']}";
                    }
                });

            }
        });
    </script>
    
</body>
</html>
